                <script src="<?php echo base_url('public_source/javascript/jquery-1.9.1.js');?>" type="text/javascript"></script>
        <script src="<?php echo base_url('public_source/javascript/jquery-ui.js');?>" type="text/javascript"></script>
<script>
        $(document).ready(function(){
                $("#jquery_link a").click(function(){
		var url = $(this).attr("href");
		$.ajax({
			type: "POST",
			url: url,
			data: "ajax=aaa",
			async: false,
			beforeSend: function(){
				$("#list_table").html("");
			},
			success: function(kq){
				$("#list_table").html(kq);
			}
		});
		return false;
                });	
                
                $("#delete a").click(function(){
                $.ajax({
			type: "POST",
			url: "<?php echo site_url("home_admin/list_sp") ?>" + "/" + $("#dong").val(),
			data: { mabaihat : $(this).attr("id"), uri : $(this).attr("class")},
			async: false,
			beforeSend: function(){
				$("#list_table").html("");
			},
			success: function(kq){
				$("#list_table").html(kq);
			}
		});
		return false;
                });	
        });
        </script>
<div id="list_table">
                  <!-- Paging -->
                  <div id="jquery_link" class="pagination">
                  <?php
                    $count1= count($sp);
                    if($count1>0){
                        echo $pagination;
                        echo " | Tổng số bài hát : ".$count1;
                    }
                  ?>
                  </div>

                    <table width="75%" cellpadding="2" cellspacing="2">
                          <tbody>
                          <tr>
                            <td width="20%" class="table_titile">Tên sản phẩm</td>
                            <td width="20%" class="table_titile">Hình ảnh</td>
                            <td width="20%" class="table_titile">Giá sản phẩm</td>
                            <td width="20%" class="table_titile">Trạng thái</td>
                            <td width="20%" class="table_titile">Modify</td>
                          </tr>
                          <?php
                            $count= count($sp);
                            if($count>0){
                                foreach ($sp as $item) {
                                    $count++;
                                    if($count%2==0)
                                        echo "<tr class='row_chan'>";
                                    else
                                        echo "<tr>";
                                    echo '<td>'.$item['ten'].'</td>';
                                    echo '<td><img style="padding: 5px" src="'.base_url($item['hinh']).'" width="60px" height="60px"></td>';
                                    echo '<td>'.$item['gia'].'</td>';
                                    if ($item['fldStatus'] == 1)
                                        echo '<td>Sản phẩm khuyến mãi</td>';
                                    else
                                        echo '<td>Sản phẩm mới</td>';
                                    echo '<td class="alt">
                                            <a href="'.site_url('home_admin/edit_sp')."/".$item["id"].'">Edit</a>
                                            <div id="delete" style="float: left; margin-right: 4px"><a id="'.$item["id"].'" style="cursor : pointer" class="'.$uri.'" id="'.'">Delete</a></div>
                                         </td>';
                                    echo "</tr>";  
                                }
                            }
                          ?>
                    </tbody>
                   </table>
</div>